package com.example.demo.api.factory;

import com.example.demo.api.RemoteOrderService;
import com.example.demo.api.model.SeataOrder;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteOrderFallbackFactory implements FallbackFactory<RemoteOrderService> {
    @Override
    public RemoteOrderService create(Throwable throwable) {
        return new RemoteOrderService() {
            @Override
            public SeataOrder create(Integer userId, String commodityCode, Integer orderCount) {
                return null;
            }
        };
    }
}
